package com.study.shengsiyuan.example01;


import io.netty.channel.ChannelInitializer;
import io.netty.channel.ChannelPipeline;
import io.netty.channel.socket.SocketChannel;
import io.netty.handler.codec.http.HttpServerCodec;

public class TestServerInitializer extends ChannelInitializer<SocketChannel> {
    //初始化channel
    @Override
    protected void initChannel(SocketChannel ch) throws Exception {
        ChannelPipeline pl = ch.pipeline(); //连接所有处理器
        pl.addLast("httpServerCodec", new HttpServerCodec()) //http编解码
                .addLast("testHttpServerHandler", new TestHttpServerHandler());
    }

}
